package cn.itcast.bos.dao.take_delivery;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.take_delivery.WayBill;

public interface WayBillRepository extends JpaRepository<WayBill, Integer> {

	WayBill findByWayBillNum(String wayBillNum);
	
	@Query("select id from WayBill where wayBillNum=?")
	Integer getWayBillId(String wayBillNum);
	
	@Query("select signStatus from WayBill where id=?")
	Integer getSignStatus(Integer id);
	
	@Query("from WayBill w inner join fetch w.order o where o.id = ?")
	WayBill findByOrderId(Integer orderId);

}
